#include "lvglthread.h"
#include <QDebug>
#include <QApplication>
#include "lvgl/porting/lv_port_disp_template.h"
#include "lvgl/porting/lv_port_indev_template.h"
#include "lv_demo_widgets.h"
LvglThread::LvglThread()
{
    timer = new QTimer;
    connect(timer, &QTimer::timeout, this, [=]{lv_tick_inc(20);});

    timer->start(5);
}

void LvglThread::run()
{
    lv_init();
    lv_port_disp_init();
    lv_port_indev_init();
    lv_demo_widgets();
    while(1)
    {
        lv_task_handler();
        msleep(1000/60);
    }

}
